#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(ui->pushButton,&QPushButton::clicked,this,&Widget::HandleClicked);
}

Widget::~Widget()
{
    delete ui;
}
void Widget::HandleClicked()
{
    this->setWindowTitle("标题1");
}

void Widget::on_pushButton_2_clicked()
{
     disconnect(ui->pushButton,&QPushButton::clicked,this,&Widget::HandleClicked);
     this->setWindowTitle("标题2");
}
